﻿#pragma once

#include "MirImageControl.h"
#include "MirLabel.h"
#include <string>
#include "../../tangible_event.h"

using namespace Client::MirSounds;

namespace Client::MirControls
{
    class MirButton : public MirImageControl
    {
        #pragma region Font Colour
    public:
        virtual ~MirButton()
        {
            delete _label;
        }

        Color *getFontColour() const;
        void setFontColour(Color *value);
        #pragma endregion

        #pragma region Hover Index
    private:
        int _hoverIndex = 0;
    public:
        int getHoverIndex() const;
        void setHoverIndex(int value);
        TangibleEvent<EventHandler> *HoverIndexChanged = new TangibleEvent<EventHandler>();
    private:
        void OnHoverIndexChanged();
        #pragma endregion

        #pragma region Index
    public:
        int getIndex() const override;
        void setIndex(int value) override;
        #pragma endregion

        #pragma region Label
    private:
        MirLabel *_label;
        #pragma endregion

        #pragma region CenterText
        bool _center = false;
    public:
        bool getCenterText() const;
        void setCenterText(bool value);
        #pragma endregion

        #pragma region Pressed Index
    private:
        int _pressedIndex = 0;
    public:
        void setPressedIndex(int value);
        int getPressedIndex() const;

        TangibleEvent<EventHandler> *PressedIndexChanged = new TangibleEvent<EventHandler>();
    private:
        void OnPressedIndexChanged();
        #pragma endregion

        #pragma region Size
    protected:
        void OnSizeChanged() override;
        #pragma endregion

        #pragma region Text
    public:
        void setText(const std::string &value);
        #pragma endregion

        MirButton();

    protected:
        void Highlight() override;
        void Activate() override;
        void Dehighlight() override;
        void Deactivate() override;


        #pragma region Disposable
        void Dispose(bool disposing) override;
        #pragma endregion
    };
}
